
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
filename-regex
Advanced tools
Regular expression for matching file names, with or without extension.
npm i filename-regex --save
The regex is returned as a function.
var regex = require('filename-regex');
var match = 'abc/xyz.md'.match(regex());
//=> match[0] = 'xyz.md'
//=> match[1] = 'xyz'
//=> match[2] = '.md'
var match = 'abc/xyz'.match(regex());
//=> match[0] = 'xyz'
//=> match[1] = 'xyz'
//=> match[2] = ''
var match = 'abc/.gitignore'.match(regex());
//=> match[0] = '.gitignore'
//=> match[1] = ''
//=> match[2] = '.gitignore'
Install dev dependencies:
node i -d && mocha
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Jon Schlinkert
Copyright (c) 2014 Jon Schlinkert
Released under the MIT license
This file was generated by verb on December 28, 2014.
The 'path' module is a built-in Node.js module that provides utilities for working with file and directory paths. It includes methods like path.basename() to extract the filename from a path. Unlike filename-regex, it does not use regular expressions but provides a more comprehensive set of path manipulation utilities.
The 'glob' package is used for matching files using patterns. It provides a more powerful and flexible way to find files based on patterns, including filenames. While filename-regex focuses on extracting filenames using a regex, glob can be used to search for files matching complex patterns in directories.
The 'micromatch' package is a powerful globbing library that supports advanced matching features. It can be used to match filenames and paths using glob patterns. Compared to filename-regex, micromatch offers more advanced pattern matching capabilities and is suitable for more complex use cases.
FAQs
Regular expression for matching file names, with or without extension.
We found that filename-regex demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.